package com.minglead.crawler.feign;

import com.minglead.crawler.base.ActionResult;
import com.minglead.crawler.entity.YqCrawlerEntity;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@FeignClient(name = "price", url = "http://192.168.5.10:38888")
public interface PriceFeignClient {

    @Operation(summary = "获取所有爬虫媒体状态")
    @GetMapping("/yq/yqCrawler/listCrawlerState")
    ActionResult listCrawlerState();

    @Operation(summary = "根据名称更新爬虫媒体")
    @PostMapping("/yq/yqCrawler/updateCrawlerByName")
    ActionResult updateCrawlerByName(@RequestBody YqCrawlerEntity yqCrawlerEntity);

    @Operation(summary = "接收JSON格式文件数据参数 保存爬虫日志文件")
    @PostMapping("/yq/yqCrawler/saveFiles")
    ActionResult saveFiles(@RequestBody String jsonData);

    @Operation(summary = "获取全局关键词")
    @GetMapping("/yq/yqCrawler/getGlobalKeyword")
    ActionResult getGlobalKeyword();

    @Operation(summary = "接收4张表参数，保存数据")
    @PostMapping("/yq/yqCrawler/updateCrawlerData")
    ActionResult updateCrawlerData(@RequestBody Map<String, Object> map);

}
